﻿/**
 * @file httpd.c
 * @author septem (jsm920@outlook.com)
 * @brief @see httpd.h
 * @version 0.0.1
 * @date 2024-10-06
 * 
 * @copyright Copyright (c) 2024
 * 
 */
#include "httpd.h"

#if defined(_WIN32) && defined(_MSC_VER)
// #pragma execution_character_set("utf-8")
#define WIN32_LEAN_AND_MEAN // 预处理器宏定义，它告诉编译器仅包含Windows SDK中最常用的函数和数据类型，从而减小编译时间和生成的可执行文件大小。
#include <stdio.h>
#include <stdlib.h>
#ifndef _DEBUG 
#pragma comment(linker, "/SUBSYSTEM:WINDOWS" )
#endif
#elif defined(__linux__)
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#endif

#if defined(_WIN32) && defined(_MSC_VER)
#ifdef _DEBUG 
int main(int argc, char* argv)
#else
int WINAPI WinMain(
   HINSTANCE hInstance,
   HINSTANCE hPrevInstance,
   PSTR szCmdLine,
   int iCmdShow)
#endif
#elif defined(__linux__)
int main(int argc, char* argv)
#endif
{
    cfg_t* pcfg = CfgMalloc(10);
    if(pcfg == NULL)
    {
        exit(-1);
    }
    if(-1 == CfgOpen("./src/httpd/test/httpd.cfg",pcfg))
    {
        CfgFree(pcfg);
        return(-1);
    }
    if(-1 == CfgParse( pcfg ))
    {
        printf("Error:CfgParse error\n");
    }
    CfgFree(pcfg);
    exit(0);
}
